package com.imooc.utils;

import com.imooc.domain.Result;

public class ResultUtil {
    /**
     * 成功且有返回内容
     * @param object
     * @return
     */
    public static Result success(Object object){
        return new Result(0,"成功",object);
    }

    /**
     * 成功但没有返回内容
     * @return
     */
    public static Result success(){
        return  success(null);
    }

    /**
     * 失败
     * @param code
     * @param msg
     * @return
     */
    public static Result error(Integer code, String msg){
        return new Result(code,msg,null);
    }
}
